Apple II
Technical Notes
_____________________________________________________________________________
                                                  Developer Technical Support


Apple IIGS
#43:    Undocumented Feature of CalcMenuSize

Written by:    Dan Oliver                                       November 1988

This Technical Note documents that CalcMenuSize can accept a parameter of 
$FFFF to recalculate menus with uninitialized heights and widths.
_____________________________________________________________________________

The newWidth and newHeight parameters of CalcMenuSize can be the actual new 
width and height or zero to automatically compute the width and the height.  
In addition to these two possibilities, you can also pass $FFFF in newWidth, 
newHeight, or even both to tell CalcMenuSize to automatically compute the 
width and height only if the current setting is zero.  Here are some examples 
of how these three, previously undocumented features might be used:

Pass a New Value

Pass a new value when you need the width and height to be a specific size.

Pass $0000

Pass $0000 when you want to compute a new value regardless of the current 
value.  You could compute a new value after you add or delete a new item or 
change its title since the current values for width and height are set to the 
current size which may be incorrect due to the change.  Passing $0000 adjusts 
the menu size according to the new menu items.

Pass $FFFF

Pass $FFFF when you want to compute a new value only when the current value is 
zero, as when the menu is first created.  FixMenuBar passes $FFFF to compute 
sizes for only those menus with widths and heights of zero.


Further Reference
o    Apple IIGS Toolbox Reference, Volume 1

